Skip to content

Conversation

ZenasSong
Copy link

The thread stack size could be critical on mobile devices. Adding the param thread_stack_size could be more flexible, especially for building a mobile application.

Does your PR solve an issue?

Delete this text and add "fixes #(issue number)".

Do not just list issue numbers here as they will not be automatically closed on merging this pull request unless prefixed with "fixes" or "closes".

Is this a breaking change?

Delete this text and answer yes/no and explain.

If yes, this pull request will need to wait for the next major release (0.{x + 1}.0)

Behavior changes can be breaking if significant enough.
Consider Hyrum's Law:

With a sufficient number of users of an API,
it does not matter what you promise in the contract:
all observable behaviors of your system
will be depended on by somebody.

@@ -191,6 +192,8 @@ impl SqliteConnectOptions {
// Soft limit on the number of rows that `ANALYZE` touches per index.
pragmas.insert("analysis_limit".into(), None);

let default_thread_stack_size = 512 * 1024; // 512KB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not comfortable making the default stack size this small. Because we invoke user-supplied callbacks from the worker thread, it's impossible to say what a safe minimum stack size is besides the current default.

Additionally, there's no leeway for platform-specific requirements. 64-bit platforms are going to need more stack size than 32-bit platforms because the size of pointers and usize/isize values is doubled.

This should be Option<usize> and default to not specifying a stack size and just letting the std choose.

Copy link
Author

@ZenasSong ZenasSong Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with you, I'll post a new PR!

@abonander
Copy link
Collaborator

Closing due to inactivity and unaddressed feedback. Feel free to open a new PR after addressing the comment.

@abonander abonander closed this Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants